<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        ul {
            background-color: blanchedalmond;
        }

        li {
            border: 1px solid;
        }
    </style>
</head>

<body>
    <ul id="parent">
        <li class="item">菜单一</li>
        <li class="item">菜单二</li>
        <li class="item">菜单三</li>
    </ul>

    <script>
        const parentEle = document.getElementById('parent');

        parentEle.onclick = function (event) {

            if (event.target.className == 'item') {
                console.log("页面跳转");
            }

            // if(event.target.nodeName === 'LI') {
            //     console.log("页面跳转");
            // }

        }


    </script>
</body>

</html>